#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

#include <iostream>

int main(int argc, char *argv[]) {
  std::string pcdfile =
      "/home/wengyu/vincent/workspace/git/lidar-record/src/convert/"
      "1760692624300104.pcd";
  pcl::PointCloud<pcl::PointXYZI> cloud;
  if (pcl::io::loadPCDFile<pcl::PointXYZI>(pcdfile, cloud) == -1) {
    std::cout << "Cloud reading failed." << std::endl;
    return (-1);
  }
  pcl::io::savePCDFileASCII(pcdfile + "txt", cloud);
  // std::cout << cloud->width << std::endl;
  // std::cout << cloud->height;
  return (0);
}